package com.wzapp.sitposture.eshop.service;/**
 * Created by qianglong on 2018/1/26.
 */

import com.wzapp.sitposture.common.base.HeaderParam;
import com.wzapp.sitposture.common.error.CustomizedException;
import com.wzapp.sitposture.eshop.entity.Order;
import com.wzapp.sitposture.eshop.view.UserOrderDTO;

import java.util.List;
import java.util.Map;

/**
 * 订单服务接口<br/>
 *
 * @author qianglong
 * @create 2018-01-26 16:09
 **/
public interface OrderService {

    /**
     * 功能: 支付已有的订单 <br/>
     *
     * @param userId 用户id
     * @param orderId 订单id
     * @param payMethod 支付方式
     * @param terminalType 终端类型
     * @return
     *
     * @author wangzhijun
     * @date 2018-04-26 11:44
     */
    Map<String, Object> payOrder(String userId, String orderId, Integer payMethod, String terminalType) throws CustomizedException;

    /**
     * 功能: 根据操作引擎修改订单状态<br/>
     *
     * @author qianglong
     * @create 2018/1/27 14:22
     * @param id 订单id
     * @param action 操作引擎
     * @return Order
     **/
    Order updateOrderById(String id, String action) throws CustomizedException;

    /**
     * 功能: 查询用户待支付订单<br/>
     *
     * @author qianglong
     * @create 2018/1/27 17:59
     * @param userId 用户id
     * @return Order
     **/
    Order getUserOrderByUserId(String userId)throws CustomizedException;

    /**
     * 功能: 创建订单<br/>
     *
     * @author qianglong
     * @create 2018/5/4 17:16
     * @param order 订单信息
     * @return Order
     **/
    Order createOrderInfo(Order order) throws CustomizedException;

    /**
     * 功能: 根据订单号支付订单<br/>
     *
     * @author qianglong
     * @create 2018/5/5 10:41
     * @param id 订单id
     * @param payMethod 支付方式
     * @param payCode 第三方支付编码
     * @return com.eig.eshop.entity.Order
     **/
    Order processPayOrderSuccess(String id, Integer payMethod, String payCode) throws CustomizedException;

    /**
     * 功能: 自动创建订单<br/>
     *
     * @author qianglong
     * @create 2019/2/3 11:35
     * @param 
     * @return void
     **/
    void autoCreateOrder();
    /**
     * 功能: 定时自动清理未支付的用户环信账号<br/>
     *
     * @author qianglong
     * @create 2019/9/30 22:53
     * @param
     * @return void
     **/
    void autoDeleteUnpaidUserHuanXin();
    /**
     * 功能: 根据用户id创建环信账号<br/>
     *
     * @author qianglong
     * @create 2019/10/1 0:37
     * @param userId
     * @return void
     **/
    void createHuanXinByUserId(String userId);
    /**
     * 功能: 查询所有已付款订单信息<br/>
     *
     * @author qianglong
     * @create 2019/10/23 21:32
     * @param 
     * @return java.util.List<com.wzapp.sitposture.eshop.view.UserOrderDTO>
     **/
    List<UserOrderDTO> findAllPaidUserOrder();
}
